package com.example.crt_dispatching_center.service.impl;

import com.example.crt_dispatching_center.entity.FlowDaily;
import com.example.crt_dispatching_center.mapper.FlowMapper;
import com.example.crt_dispatching_center.service.FlowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.util.List;
@Service
public class FlowServiceImpl implements FlowService {


    @Autowired
    private FlowMapper flowMapper;

    @Override
    public List<FlowDaily> getPastFlow() {
        LocalDate endDate = LocalDate.now();
        LocalDate startDate = endDate.minusDays(7);
        return flowMapper.findByDateBetween(startDate, endDate);
    }
}
